


use Utilitarianism or Cosmopolitanism.dta
set more off
set scheme s1mono



* Replication for all tables and figures in the article and appendix
* Data and codes for tables a15 and a16 are in an additional file
* Survey data are drawn from the second wave of the Asian Barometer Survey 
* Original data application is available from http://www.asianbarometer.org/
* All variables below have been (re)coded and cleaned for ease of interpretation
* Analyses run using Stata 15
 


*****************check the original measurement of education level**************
ca q164 edu_level, dim(4) 
ca q165 edu_level, dim(4)
ca q166 edu_level, dim(4) 
 /*the first four dimensions account for respectively 93%, 89%, 
   and 97% of the total inertia*/



/*one-way analysis-of-variance (ANOVA)*/
oneway edu_level q164 if q164==2 | q164==1, ta
 /*p=0.59, difference=|5.3188908-5.2327044|=0.09*/

oneway edu_level q165 if q165==8 | q165==9, ta
 /*p=0.63, difference=|5.7523302-5.6753731|=0.08*/

oneway edu_level q166 if q166==8 | q166==9, ta
 /*p=0.79, difference=|6.2926829-6.3195719|=0.03*/
 


**********************ordered logit models (see table 2)************************
/*united states*/
ologit us_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us.xls, excel e(ll chi2) label dec(2) 2aster replace
 /*outreg2 is a user-written command that requires installing
   if not be installed before (ssc install outreg2)*/
estat ic
estimate store base

ologit us_4 c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic
estimate store interaction
lrtest interaction base /*likelihood-ratio test does not show that the second
                          model improves goodness of fit (p=0.57)*/

/*china*/
ologit cn_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit cn_4 c.edu_level##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*japan (exclude respondents in japan)*/
ologit jp_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit jp_4 c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic



**********************marginal effect plots (see figure 1)**********************
/*average marginal effect of education level on attitude toward usa*/
quietly ologit us_4 edu_level demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*

margins, predict(outcome(4)) at(edu_level=(1(1)10)) vsquish
marginsplot, name(plot1,replace) ///
recast(line) recastci(rline) ciopts(lpattern(dash)) ///
xlabel(1 "1=no" 2 "." 3 "3=primary" ///
4 "." 5 "5=technical" 6 "." ///
7 "7=high" 8 "." 9 "." ///
10 "10=postgrad" , angle(18) labsize(small)) ///
ytitle(Predicted probability of a positive attitude, size(medsmall)) ///
xtitle(Level of education, size(medsmall)) ///
title("(a)", size(medium)) ylabel(, angle(horizontal) labsize(small)) ///
scale(1) aspect(1)
 /*when edu_level changes from 1 to 10, the predicted probability of a positive 
   attitude changes from 0.2465238 to 0.2841737, an increase of 
   3.76 percentage points*/

margins, predict(outcome(1)) at(edu_level=(1(1)10)) vsquish
marginsplot, name(plot2,replace) ///
recast(line) recastci(rline) ciopts(lpattern(dash)) ///
xlabel(1 "1=no" 2 "." 3 "3=primary" ///
4 "." 5 "5=technical" 6 "." ///
7 "7=high" 8 "." 9 "." ///
10 "10=postgrad" , angle(18) labsize(small)) ///
ytitle(Predicted probability of a negative attitude, size(medsmall)) ///
xtitle(Level of education, size(medsmall)) ///
title("(b)", size(medium)) ylabel(, angle(horizontal) labsize(small)) ///
scale(1) aspect(1)
 /*when edu_level changes from 1 to 10, the predicted probability of a negative 
   attitude changes from 0.2068755 to 0.1766685, a decrease of 
   3.02 percentage points*/

graph combine plot1 plot2  
graph save fig1.gph, replace


/*average marginal effect of education level on attitude toward china*/
ologit cn_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
margins, predict(outcome(4)) at(edu_level=(1(1)10)) vsquish 
 /*increase of 3.05 percentage points*/
margins, predict(outcome(1)) at(edu_level=(1(1)10)) vsquish 
 /*decrease of 2.97 percentage points*/


/*average marginal effect of education level on attitude toward japan*/
ologit jp_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
margins, predict(outcome(4)) at(edu_level=(1(1)10)) vsquish 
 /*increase of 12.12 percentage points*/
margins, predict(outcome(1)) at(edu_level=(1(1)10)) vsquish 
 /*decrease of 3.90 percentage points*/
 

 
********************************************************************************
********************************************************************************
*********** marginal effect plots based on model (4) in table 2;        ******** 
*********** (see figure a1 in online appendix)                          ********
********************************************************************************
********************************************************************************
quietly ologit cn_4 c.edu_level##i.capital ///
demo c.income##c.income unequal situation conser patriot pointerest urban ///
male religiosity age i.occupation country_d1-country_d6 country_d8
 
margins capital, at(edu_level=(1(1)10)) predict(outcome(4))  
marginsplot, noci xlabel(1 "1=no" 2 "." 3 "3=primary" ///
4 "." 5 "5=technical" 6 "." 7 "7=high" 8 "." 9 "." ///
10 "10=postgrad" , angle(18) labsize(small)) ///
ytitle(Predicted probability of a positive attitude, size(medsmall)) ///
xtitle("Level of education") title("", size(medium)) ///
ylabel(, angle(horizontal) labsize(small)) scale(1) aspect(0.7) ///
legend(order(1 "Labor-adundant country" 2 "Capital-adundant country") ///
rows(2) position(1) ring(0) size(medsmall))
graph save figa1.gph, replace


 
********************************************************************************
********************************************************************************
*********** robustness checks: change the measurement of dependent      ******** 
***********                    variable and/or key independent variable ********
********************************************************************************
********************************************************************************

*********dv: 4-category; iv: edu_year (see table a3 in online appendix)*********
/*united states*/
ologit us_4 edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_4.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit us_4 c.edu_year##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_4.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*china*/
ologit cn_4 edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_4.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit cn_4 c.edu_year##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_4.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*japan (exclude respondents in japan)*/
ologit jp_4 edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp_4.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit jp_4 c.edu_year##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp_4.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic



**********dv: trinary; iv: edu_level (see table a4 in online appendix)**********
/*united states*/
ologit us_t edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_t.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit us_t c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_t.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*china*/
ologit cn_t edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_t.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit cn_t c.edu_level##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_t.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*japan (exclude respondents in japan)*/
ologit jp_t edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp_t.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit jp_t c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp_t.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic



************dv: trinary; iv: edu_year (see table a5 in online appendix)*********
/*united states*/
ologit us_t edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_t.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit us_t c.edu_year##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_t.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*china*/
ologit cn_t edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_t.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit cn_t c.edu_year##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_t.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*japan (exclude respondents in japan)*/
ologit jp_t edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp_t.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

ologit jp_t c.edu_year##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp_t.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic



*************dv: binary; iv: edu_level (see table a6 in online appendix)********
/*united states*/
logit us_b edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_b.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

logit us_b c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_b.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*china*/
logit cn_b edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_b.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

logit cn_b c.edu_level##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_b.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*japan (exclude respondents in japan)*/
logit jp_b edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp_b.xls, excel e(ll chi2) label dec(2) 2aster replace
estat ic

logit jp_b c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp_b.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic



************dv: binary; iv: edu_year (see table a7 in online appendix)**********
/*united states*/
logit us_b edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_b.xls, excel e(ll chi2) label dec(2) 2aster replace
centile edu_year, centile(0 5 95 100)
mchange edu_year, amount(range) trim(5) stat(change from to pvalue) brief
 /*a change of one's years of formal education from the 5th percentile of 
   4 years to the 95th percentile of 16 years on average increases the 
   probability of a positive attitude toward usa from 0.523 to 0.594, 
   an increase of 0.071*/
 /*mchange is a user-written command (based on spost13_ado.pkg) that requires 
   installing if not be installed before*/
estat ic

logit us_b c.edu_year##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_b.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*china*/
logit cn_b edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_b.xls, excel e(ll chi2) label dec(2) 2aster replace
centile edu_year, centile(0 5 95 100)
mchange edu_year, amount(range) trim(5) stat(change from to pvalue) brief
 /*a change of one's years of formal education from the 5th percentile of 
   4 years to the 95th percentile of 16 years on average increases the 
   probability of a positive attitude toward china from 0.452 to 0.496, 
   an increase of 0.044*/
estat ic

logit cn_b c.edu_year##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_b.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic


/*japan (exclude respondents in japan)*/
logit jp_b edu_year demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp_b.xls, excel e(ll chi2) label dec(2) 2aster replace
centile edu_year, centile(0 5 95 100)
mchange edu_year, amount(range) trim(5) stat(change from to pvalue) brief
 /*a change of one's years of formal education from the 5th percentile of 
   4 years to the 95th percentile of 16 years on average increases the 
   probability of a positive attitude toward japan from 0.629 to 0.744, 
   an increase of 0.115*/
estat ic

logit jp_b c.edu_year##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp_b.xls, excel e(ll chi2) label dec(2) 2aster append
estat ic



************************tables of descriptive statistics************************
/*table a2 in online appendix*/
logout, save(q_1) word replace: sum(us_4 cn_4 jp_4 edu_level edu_year ///
trust info breadth demo income unequal situation conser patriot ///
pointerest urban male religiosity age occupation)
 /*logout is a user-written command that requires installing if not be 
   installed before (ssc install logout)*/

logout, save(q_2) word dec(2) replace: sum(us_4 cn_4 jp_4 edu_level edu_year ///
trust info breadth demo income unequal situation conser patriot ///
pointerest urban male religiosity age occupation)


/*table a1 in online appendix*/
logout, save(q_3)  word replace: ta country
logout, save(q_41) word dec(2) replace: ta country, summarize(us_4)
logout, save(q_42) word dec(2) replace: ta country, summarize(cn_4)
logout, save(q_43) word dec(2) replace: ta country, summarize(jp_4)


/*table a12 in online appendix*/
logout, save(q_51) word replace: ta edu_level
logout, save(q_52) word replace: ta edu_level, nol
logout, save(q_53) word dec(2) replace: ta edu_level, nolabel



********structural equation models (see table a8 in online appendix)************
/*sem of the united states (see figure 2)*/
gsem (trust      <-edu_level,   logit)                                     ///
     (info_sem   <-edu_level,   regress)                                   ///
	 (breadth_sem<-edu_level,   regress)                                   ///
	 (us_4       <-edu_level,   ologit)                                    ///
     (us_4       <-trust,       ologit)                                    ///
	 (us_4       <-info_sem,    ologit)                                    ///
	 (us_4       <-breadth_sem, ologit)                                    ///
	 (us_4       <-demo c.income##c.income unequal situation conser        ///
	               patriot pointerest urban male religiosity age           ///
				   i.occupation country_d*, ologit)
outreg2 using sem_1.xls, excel label dec(2) 2aster replace
estat ic    /*AIC=69044, BIC=69327*/

	 
/*sem of china (see figure 3)*/
gsem (trust      <-edu_level,   logit)                                     ///
     (info_sem   <-edu_level,   regress)                                   ///
	 (breadth_sem<-edu_level,   regress)                                   ///
	 (cn_4       <-edu_level,   ologit)                                    ///
     (cn_4       <-trust,       ologit)                                    ///
	 (cn_4       <-info_sem,    ologit)                                    ///
	 (cn_4       <-breadth_sem, ologit)                                    ///
	 (cn_4       <-demo c.income##c.income unequal situation conser        ///
	               patriot pointerest urban male religiosity age           ///
				   i.occupation country_d*, ologit)
outreg2 using sem_2.xls, excel label dec(2) 2aster replace
estat ic    /*AIC=69140.24, BIC=69423.24*/


/*sem of japan (see figure 4)*/
gsem (trust      <-edu_level,   logit)                                     ///
     (info_sem   <-edu_level,   regress)                                   ///
	 (breadth_sem<-edu_level,   regress)                                   ///
	 (jp_4       <-edu_level,   ologit)                                    ///
     (jp_4       <-trust,       ologit)                                    ///
	 (jp_4       <-info_sem,    ologit)                                    ///
	 (jp_4       <-breadth_sem, ologit)                                    ///
	 (jp_4       <-demo c.income##c.income unequal situation conser        ///
	               patriot pointerest urban male religiosity age           ///
				   i.occupation country_d*, ologit) if country!=1
outreg2 using sem_3.xls, excel label dec(2) 2aster replace
estat ic    /*AIC=62965.73, BIC=63238.29*/
	 

	 
/*only keep the indirect effect through breadth (see figure 5)*/
/*refined model of the united states*/
gsem (breadth_sem <-edu_level,   regress)                                ///
	 (us_4        <-breadth_sem, ologit)                                 ///
	 (us_4        <-demo c.income##c.income unequal situation conser     ///
	                patriot pointerest urban male religiosity age        ///
				    i.occupation country_d*, ologit)
estat ic    /*AIC=38371.67, BIC=38599.44*/
outreg2 using sem_4.xls, excel label dec(2) 2aster replace


/*refined model of china*/
gsem (breadth_sem <-edu_level,   regress)                                ///
	 (cn_4        <-breadth_sem, ologit)                                 ///
	 (cn_4        <-demo c.income##c.income unequal situation conser     ///
	                patriot pointerest urban male religiosity age        ///
				    i.occupation country_d*, ologit)
estat ic    /*AIC=38465.96, BIC=38693.74*/
outreg2 using sem_5.xls, excel label dec(2) 2aster replace


/*refined model of japan*/
gsem (breadth_sem <-edu_level,   regress)                                ///
	 (jp_4        <-breadth_sem, ologit)                                 ///
	 (jp_4        <-demo c.income##c.income unequal situation conser     ///
	                patriot pointerest urban male religiosity age        ///
				    i.occupation country_d*, ologit)  if country!=1
estat ic    /*AIC=34777.1, BIC=34995.14*/
outreg2 using sem_6.xls, excel label dec(2) 2aster replace



************************attitudes toward un and imf*****************************
/*sem of un (see figure 6)*/
gsem (trust      <-edu_level,   logit)                                     ///
     (info_sem   <-edu_level,   regress)                                   ///
	 (breadth_sem<-edu_level,   regress)                                   ///
	 (un         <-edu_level,   ologit)                                    ///
     (un         <-trust,       ologit)                                    ///
	 (un         <-info_sem,    ologit)                                    ///
	 (un         <-breadth_sem, ologit)                                    ///
	 (un         <-demo c.income##c.income unequal situation conser        ///
	               patriot pointerest urban male religiosity age           ///
				   i.occupation country_d*, ologit)
outreg2 using sem_7.xls, excel label dec(2) 2aster replace


/*sem of imf (see figure 7)*/
gsem (trust      <-edu_level,   logit)                                     ///
     (info_sem   <-edu_level,   regress)                                   ///
	 (breadth_sem<-edu_level,   regress)                                   ///
	 (imf        <-edu_level,   ologit)                                    ///
     (imf        <-trust,       ologit)                                    ///
	 (imf        <-info_sem,    ologit)                                    ///
	 (imf        <-breadth_sem, ologit)                                    ///
	 (imf        <-demo c.income##c.income unequal situation conser        ///
	               patriot pointerest urban male religiosity age           ///
				   i.occupation country_d*, ologit)
outreg2 using sem_8.xls, excel label dec(2) 2aster replace



********************************************************************************
********************************************************************************
********  check whether educational effect is condtional on a country's   ****** 
********  level of democracy; data are obtained from freedom house        ******
********  (see table a9 in online appendix)                               ******
********************************************************************************
********************************************************************************

/*united states*/
ologit us_4 edu_level free inter demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_f.xls, excel label dec(2) 2aster replace


/*china*/
ologit cn_4 edu_level free inter demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_f.xls, excel label dec(2) 2aster replace


/*japan*/
ologit jp_4 edu_level free inter demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1
outreg2 using jp_f.xls, excel label dec(2) 2aster replace



********************************************************************************
********************************************************************************
********  bivariate probit regression to account for correlated errors  ******** 
********  (maximum-likelihood two-equation probit models)               ********
********  (see table a11 in online appendix)                            ********
********************************************************************************
********************************************************************************

/*united states & china*/
biprobit us_b cn_b edu_level demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_cn.xls, excel label dec(2) 2aster replace


/*china & japan*/
biprobit cn_b jp_b edu_level demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_jp.xls, excel label dec(2) 2aster replace


/*united states & japan*/
biprobit us_b jp_b edu_level demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_jp.xls, excel label dec(2) 2aster replace	 
	 
	 

********************************************************************************
********************************************************************************
********  normalization of the original dv (ols regression)             ******** 
********  (see table a13 in online appendix)                            ********
********************************************************************************
********************************************************************************

/*united states*/
reg us_n edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_n.xls, excel label dec(2) 2aster replace

reg us_n c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using us_n.xls, excel label dec(2) 2aster append


/*china*/
reg cn_n edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_n.xls, excel label dec(2) 2aster replace

reg cn_n c.edu_level##i.capital demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation country_d*
outreg2 using cn_n.xls, excel label dec(2) 2aster append


/*japan (exclude respondents in japan)*/
reg jp_n edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if country !=1
outreg2 using jp_n.xls, excel label dec(2) 2aster replace

reg jp_n c.edu_level##i.labor demo c.income##c.income unequal situation ///
conser patriot pointerest urban male religiosity age i.occupation ///
country_d* if country !=1 
outreg2 using jp_n.xls, excel label dec(2) 2aster append



********************************************************************************
********************************************************************************
********  subgrouping: labor-abundant countries only                    ******** 
********  (see table a14 in online appendix)                            ********
********************************************************************************
********************************************************************************
 
/*individual attitudes toward united states, labor-abundant countries only*/
ologit us_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if labor==1
outreg2 using sub_2.xls, excel e(ll chi2) label dec(2) 2aster replace


/*individual attitudes toward japan, labor-abundant countries only*/
ologit jp_4 edu_level demo c.income##c.income unequal situation conser patriot ///
pointerest urban male religiosity age i.occupation country_d* if labor==1
outreg2 using sub_3.xls, excel e(ll chi2) label dec(2) 2aster replace
	 
	 
	 
	 
	 
	 
	 
	 